package entities;

import java.io.Serializable;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Idan
 *This class is responsible to hold qulity control report data
 */
public class QCReport implements Serializable
{
	private Timestamp qcDate;
	private String orderID;
	private String sterilizationID;
	private int failSetFlag; // fails count. Also used as quantity count for raw materials fail report
	private int repolishSetFlag; // repolish count
	//private String comments;
	private int deviationCountPlus05;
	private int deviationCountMinus05;
	private int deviationCountPlus10;
	private int deviationCountMinus10;
	private int deviationCountElse;
	
	private String rawMaterialID;

	
	private FailSet failset;
	private RepolishSet repolishset;
	
	private int orderQuantity;
	
	
	
	public Timestamp getQcDate()
	{
		return qcDate;
	}
	public void setQcDate(Timestamp qcDate) 
	{
		this.qcDate = qcDate;
	}
	
	public void setQCDateAsString(String date)
	{	
		Date formattedDate;
		try 
		{
			formattedDate = new SimpleDateFormat("dd/MM/yyyy").parse(date);
			this.qcDate = new Timestamp(formattedDate.getTime());
		} catch (ParseException e)
		{
			// TODO Auto-generated catch block
			//e.printStackTrace();
		}	
	}
	
	public String getDateAsString()
	{

		String formatted = new SimpleDateFormat("dd/MM/yyyy").format(qcDate);		
		return formatted;
	}
	public String getOrderID() {
		return orderID;
	}
	public void setOrderID(String orderID) {
		this.orderID = orderID;
	}
	public String getSterilizationID() {
		return sterilizationID;
	}
	public void setSterilizationID(String sterilizationID) {
		this.sterilizationID = sterilizationID;
	}
	public int getFailSetFlag() {
		return failSetFlag;
	}
	public void setFailSetFlag(int failSetFlag) {
		this.failSetFlag = failSetFlag;
	}
	public int getRepolishSetFlag() {
		return repolishSetFlag;
	}
	public void setRepolishSetFlag(int repolishSetFlag) {
		this.repolishSetFlag = repolishSetFlag;
	}
	
	public int getDeviationCountPlus05() {
		return deviationCountPlus05;
	}
	public void setDeviationCountPlus05(int deviationCountPlus05) {
		this.deviationCountPlus05 = deviationCountPlus05;
	}
	public int getDeviationCountMinus05() {
		return deviationCountMinus05;
	}
	public void setDeviationCountMinus05(int deviationCountMinus05) {
		this.deviationCountMinus05 = deviationCountMinus05;
	}
	public int getDeviationCountPlus10() {
		return deviationCountPlus10;
	}
	public void setDeviationCountPlus10(int deviationCountPlus10) {
		this.deviationCountPlus10 = deviationCountPlus10;
	}
	public int getDeviationCountMinus10() {
		return deviationCountMinus10;
	}
	public void setDeviationCountMinus10(int deviationCountMinus10) {
		this.deviationCountMinus10 = deviationCountMinus10;
	}
	public int getDeviationCountElse() {
		return deviationCountElse;
	}
	public void setDeviationCountElse(int deviationCountElse) {
		this.deviationCountElse = deviationCountElse;
	}
	public FailSet getFailset() {
		return failset;
	}
	public void setFailset(FailSet failset) {
		this.failset = failset;
	}
	public RepolishSet getRepolishset() {
		return repolishset;
	}
	public void setRepolishset(RepolishSet repolishset) {
		this.repolishset = repolishset;
	}
	public int getOrderQuantity() {
		return orderQuantity;
	}
	public void setOrderQuantity(int orderQuantity) {
		this.orderQuantity = orderQuantity;
	}
	public String getRawMaterialID() {
		return rawMaterialID;
	}
	public void setRawMaterialID(String rawMaterialID) {
		this.rawMaterialID = rawMaterialID;
	}
	
	
	
	
}
